<?php

declare(strict_types=1);

namespace sheep\library\uploader\driver;

use League\Flysystem\FilesystemAdapter;
use Xxtime\Flysystem\Aliyun\OssAdapter;
use think\filesystem\Driver;

class Aliyun extends Driver
{
    protected function createAdapter(): FilesystemAdapter
    {
        $aliyun = new OssAdapter([
            'accessId'     => $this->config['accessId'],
            'accessSecret' => $this->config['accessSecret'],
            'bucket'       => $this->config['bucket'],
            'endpoint'     => $this->config['endpoint'],
        ]);

        return $aliyun;
    }
}
